// import { m } from "js-beautif-libs";
import { menusFunc } from "../utils/js-beautif-libs/funtion";
export const ROLE_TYPE = selectOption([
  ["超级管理员", 1],
  ["管理员"],
  ["代理商"],
  ["推广员"],
]);

export const GRADE_TYPE = selectOption([
  ["一级", 1],
  ["二级", 2],
  ["三级", 3],
]);

export const DEVICE_TYPE = selectOption([
  ["tv盒子", 1],
  ["x86", 2],
  ["路由器", 3],
]);

export const SETTLEMENT_TYPE = selectOption([
  ["默认结算", 0],
  ["买断", 1],
]);

export const ORDER_TYPE = selectOption([
  ["已取消", 0],
  ["待付款"],
  ["待发货"],
  ["待收货"],
  ["已完成"],
]);

export const REPAIR_TYPE = selectOption([
  ["未处理", 0],
  ["进行中"],
  ["已完成"],
]);

export const ISP_TYPE = selectOption([["电信", 1], ["联通"], ["移动"]]);

export const BELONG_STATUS = selectOption([["未归属", 0], ["已归属"]]);

export const TRADE_TYPE = selectOption([
  ["设备销售分佣", 1],
  ["流量分佣"],
  ["提现"],
]);

export const DATE_TYPE = selectOption([
  ["昨日", 1],
  ["上周"],
  ["上月"],
  ["上年"],
]);

export const APPLICATION_STATE = selectOption([
  ["提现失败", -1],
  ["提现中", 0],
  ["提现成功", 1],
  ["正在打款", 2],
  ["抵扣", 3],
]);

export const APPLICATION_TYPE = selectOption([
  ["对私", 0],
  ["对公", 1],
]);

export const BAND_WITH_STATUS = selectOption([
  ["全部", ""],
  ["成功", "1"],
  ["失败", "-1"],
]);

export const ONLINE_STATUS = selectOption([
  ["全部", "0"],
  ["在线", "1"],
  ["离线", "2"],
]);

export const ONUSE_STATUS = selectOption([
  ["全部", "0"],
  ["未安装", "1"],
  ["已安装", "2"],
]);

export const RECODE_TYPE = selectOption([
  ["全部", ""],
  ["商品分佣", "1"],
  ["流量分佣", "2"],
  ["提现", "3"],
  ["冻结", "-1"],
  ["冻结释放", "-2"],
]);

export const BILL_TYPE = selectOption([
  ["全部", ""],
  ["未提现", "0"],
  ["体现中", "2"],
  ["提现成功", "1"],
  ["提现失败", "-3"],
]);

export const BILL_TYPE_1 = selectOption([
  ["月结账单", 0],
  ["周结账单", 1],
  ["日结账单", 2],
]);

function selectOption(list) {
  let _index = 0;
  const MAP = {};
  const options = [];
  for (let item of list) {
    if (Array.isArray(item)) {
      const [v, i] = item;
      if (i >= _index || i < 0) {
        _index = i;
      }
      MAP[_index++] = v;
    } else {
      MAP[_index++] = item;
    }
  }
  for (const [value, label] of Object.entries(MAP)) {
    options.push({
      label,
      value: +value,
    });
  }
  return options;
}



export const menus = menusFunc;
